<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <div id="app">
    <button @click="add">添加一个数据</button>
    <button @click="change">改变这个动态数据</button>
    <div v-if="isShow">
      {{ msg }}
    </div>
  </div>
  <script src="./vue.js"></script>
  <script>
    const  vm = new Vue({
      el: '#app',
      data:{
        isShow: false
      },
      methods:{
        add(){
          this.isShow = true
          this.msg = '我是动态添加的数据'
        },
        change(){
          this.msg="我改变咯"
          console.log(this)
          
          console.log(this.msg)
        }
      }
    })
  </script>
</body>
</html>